字串小幫手 on linux


Posted by Rich on 2021-08-10

grep

grep 是把資料裡面有我們要的關鍵字那整行取下來。

  • grep 的幾個指令:
    • -a:將 binary 以 text 檔案的方式進行搜尋
    • -c:計算找到‘搜尋字串’的次數
    • -i:忽略大小寫差異
    • -n:輸出行號
    • -v:輸出沒有‘搜尋字串’的資料
    • --color=auto:幫文字上色

grep 'rich' 把有“rich"的行全部取下來。
grep -v 'rich' 把沒有“rich"的行全部取下來。
搭配正規表示法,才能真正發揮 grep 的實力。


#筆記







Related Posts

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段五:求職就業+畢業)

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段五:求職就業+畢業)

每日心得筆記 2020-06-30(二)

每日心得筆記 2020-06-30(二)

OOP - 14 Liskov Substitution Principle

OOP - 14 Liskov Substitution Principle


Comments